package com.ruoyi.business.service.impl;

import java.util.List;

import com.ruoyi.common.exception.ServiceException;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.business.mapper.StoreInfoMapper;
import com.ruoyi.business.domain.StoreInfo;
import com.ruoyi.business.service.IStoreInfoService;

/**
 * 门店管理Service业务层处理
 *
 * @author 小陈
 * @date 2022-11-24
 */
@Service
public class StoreInfoServiceImpl extends ServiceImpl<StoreInfoMapper, StoreInfo> implements IStoreInfoService {

    /**
     * 查询门店管理列表
     *
     * @param storeInfo 门店管理
     * @return 门店管理
     */
    @Override
    public List<StoreInfo> selectStoreInfoList(StoreInfo storeInfo) {
        return getBaseMapper().selectStoreInfoList(storeInfo);
    }

    @Override
    public void update(StoreInfo storeInfo) {
        if(storeInfo.STORE_INFO_DEAD.equals(storeInfo.getStatus())) {
            throw new ServiceException("不能将状态修改为删除");
        }
    }

    @Override
    public void removeBatchByIds(Long[] ids) {
        getBaseMapper().removeBatchByIds(ids);
    }

    @Override
    public void restore(Long[] id) {
        getBaseMapper().restore(id);
    }

}
